<?php
/**
 * beimuaihui System
 * Copyright(c) 2011-2020 beimuaihui.
 * @license    http://www.gnu.org/licenses/gpl.html     This software Under GPL V3 License 
 * beimuaihui@gmail.com
 * http://code.google.com/p/beimuaihui/
 * $Id: Html.php 197 2011-02-18 12:45:33Z beimuaihui $
 */
class Baogg_View_Html {
	public static function MakeActionLink($text, $href, $aAttribute = array(), $img = '', $aImgAttribute = array()) {
		if (! $text) {
			$img = addslashes ( $v );
			$sImgAttribute = '';
			foreach ( ( array ) $aImgAttribute as $k => $v ) {
				$v = addcslashes ( $v, "'\\" );
				$sImgAttribute .= " $k='{$v}' ";
			}
			$text = "<img src='{BAOGG_THEME}/images/{$img}'  {$sImgAttribute}>";
		}
		$sAttribute = '';
		foreach ( ( array ) $aAttribute as $k => $v ) {
			$v = addcslashes ( $v, "'\\" );
			$sAttribute .= " $k='{$v}' ";
		}
		return "<a href='{$href}' {$sAttribute}>$text</a>";
	}
	public static function MakeEditLink($href = '#') {
		global $multi;
		return $this->MakeActionLink ( $multi->g_edit, $href, '', 'edit.gif' );
	}
}
?>